1 module opensles.android_configuration; 2 import opensles.sles; 3 /* 4 * Copyright (C) 2010 The Android Open Source Project 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 extern(C): 20 /*---------------------------------------------------------------------------*/ 21 /* Android AudioRecorder configuration */ 22 /*---------------------------------------------------------------------------*/ 23 24 /** Audio recording preset */ 25 /** Audio recording preset key */ 26 enum SL_ANDROID_KEY_RECORDING_PRESET = (cast(const SLchar*) "androidRecordingPreset"); 27 /** Audio recording preset values */ 28 /** preset "none" cannot be set, it is used to indicate the current settings 29 * do not match any of the presets. */ 30 enum SL_ANDROID_RECORDING_PRESET_NONE = (cast(SLuint32) 0x00000000); 31 /** generic recording configuration on the platform */ 32 enum SL_ANDROID_RECORDING_PRESET_GENERIC = (cast(SLuint32) 0x00000001); 33 /** uses the microphone audio source with the same orientation as the camera 34 * if available, the main device microphone otherwise */ 35 enum SL_ANDROID_RECORDING_PRESET_CAMCORDER = (cast(SLuint32) 0x00000002); 36 /** uses the main microphone tuned for voice recognition */ 37 enum SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION = (cast(SLuint32) 0x00000003); 38 /** uses the main microphone tuned for audio communications */ 39 enum SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION = (cast(SLuint32) 0x00000004); 40 /** uses the main microphone unprocessed */ 41 enum SL_ANDROID_RECORDING_PRESET_UNPROCESSED = (cast(SLuint32) 0x00000005); 42 43 44 /*---------------------------------------------------------------------------*/ 45 /* Android AudioPlayer configuration */ 46 /*---------------------------------------------------------------------------*/ 47 48 /** Audio playback stream type */ 49 /** Audio playback stream type key */ 50 enum SL_ANDROID_KEY_STREAM_TYPE = (cast(const(SLchar)*) "androidPlaybackStreamType"); 51 52 /** Audio playback stream type values */ 53 /* same as android.media.AudioManager.STREAM_VOICE_CALL */ 54 enum SL_ANDROID_STREAM_VOICE = (cast(SLint32) 0x00000000); 55 /* same as android.media.AudioManager.STREAM_SYSTEM */ 56 enum SL_ANDROID_STREAM_SYSTEM = (cast(SLint32) 0x00000001); 57 /* same as android.media.AudioManager.STREAM_RING */ 58 enum SL_ANDROID_STREAM_RING = (cast(SLint32) 0x00000002); 59 /* same as android.media.AudioManager.STREAM_MUSIC */ 60 enum SL_ANDROID_STREAM_MEDIA = (cast(SLint32) 0x00000003); 61 /* same as android.media.AudioManager.STREAM_ALARM */ 62 enum SL_ANDROID_STREAM_ALARM = (cast(SLint32) 0x00000004); 63 /* same as android.media.AudioManager.STREAM_NOTIFICATION */ 64 enum SL_ANDROID_STREAM_NOTIFICATION = (cast(SLint32) 0x00000005); 65 66 67 /*---------------------------------------------------------------------------*/ 68 /* Android AudioPlayer and AudioRecorder configuration */ 69 /*---------------------------------------------------------------------------*/ 70 71 /** Audio Performance mode. 72 * Performance mode tells the framework how to configure the audio path 73 * for a player or recorder according to application performance and 74 * functional requirements. 75 * It affects the output or input latency based on acceptable tradeoffs on 76 * battery drain and use of pre or post processing effects. 77 * Performance mode should be set before realizing the object and should be 78 * read after realizing the object to check if the requested mode could be 79 * granted or not. 80 */ 81 /** Audio Performance mode key */ 82 enum SL_ANDROID_KEY_PERFORMANCE_MODE = (cast(const(SLchar)*) "androidPerformanceMode"); 83 84 /** Audio performance values */ 85 /* No specific performance requirement. Allows HW and SW pre/post processing. */ 86 enum SL_ANDROID_PERFORMANCE_NONE = (cast(SLuint32) 0x00000000); 87 /* Priority given to latency. No HW or software pre/post processing. 88 * This is the default if no performance mode is specified. */ 89 enum SL_ANDROID_PERFORMANCE_LATENCY = (cast(SLuint32) 0x00000001); 90 /* Priority given to latency while still allowing HW pre and post processing. */ 91 enum SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS = (cast(SLuint32) 0x00000002); 92 /* Priority given to power saving if latency is not a concern. 93 * Allows HW and SW pre/post processing. */ 94 enum SL_ANDROID_PERFORMANCE_POWER_SAVING = (cast(SLuint32) 0x00000003);